import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { SystemManageComponent } from './system-manage.component';
import { RouterModule, Routes } from '@angular/router';
import { LoginActivate } from '../../core/auth/login.activate';
import { SystemReceiptComponent } from './system-receipt/system-receipt.component';
import { SystemPublishComponent } from './system-publish/system-publish.component';
import { DoFeedbackComponent } from './do-feedback/do-feedback.component';
import { SystemTofileComponent } from './system-tofile/system-tofile.component';
import { NgZorroAntdModule } from 'ng-zorro-antd';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { ShareModule } from '../../share/share.module';
import { ApprovalDetailComponent } from './approval-detail/approval-detail.component';
import { SystemFormComponent } from './system-form/system-form.component';
import {PdfJsViewerModule} from 'ng2-pdfjs-viewer';

const routes: Routes = [
  {
    path: '', component: SystemManageComponent, children: [
      {
        path: 'system-receipt',
        component: SystemReceiptComponent,
        data: {
          breadcrumb: '制度收文'
        },
        canActivate: [LoginActivate]
      },
      {
        path: 'system-publish',
        component: SystemPublishComponent,
        data: {
          breadcrumb: '制度发布'
        },
        canActivate: [LoginActivate]
      },
      {
        path: 'do-feedback',
        component: DoFeedbackComponent,
        data: {
          breadcrumb: '执行反馈'
        },
        canActivate: [LoginActivate]
      },
      {
        path: 'system-tofile',
        component: SystemTofileComponent,
        data: {
          breadcrumb: '制度归档'
        },
        canActivate: [LoginActivate]
      },
      {
        path: '', redirectTo: 'system-receipt', pathMatch: 'full'
      },
      {
        path: '**', component: SystemReceiptComponent
      }
    ]
  }
]

@NgModule({
  declarations: [
    SystemManageComponent,
    SystemReceiptComponent,
    SystemPublishComponent,
    DoFeedbackComponent,
    SystemTofileComponent,
    ApprovalDetailComponent,
    SystemFormComponent
  ],
  imports: [
    CommonModule,
    NgZorroAntdModule,
    FormsModule,
    ReactiveFormsModule,
    ShareModule,
    RouterModule.forChild(routes),
    PdfJsViewerModule
  ]
})
export class SystemManageModule { }
